Florian Müllner [Tue, 19 Dec 2023 01:35:33 +0000 (02:35 +0100)]
extensions-app: Bind actions' enabled properties
Most properties that determine the availability of an action are
not expected to change, but now that extensions are represented
as a GObject, we can just generically set up bindings for all
actions instead of explicitly tracking the properties that we
expect to change.
Florian Müllner [Wed, 20 Dec 2023 12:59:12 +0000 (13:59 +0100)]
panelMenu: Remove SystemIndicator class
It was used by components in the aggregate menu. That menu no
longer exists, and the class has been superseded by the class of
the same name in quick settings.
When an extension is disabled, we "rebase" all extensions that
were enabled afterwards, in case they override the same method.
This can be fairly expensive, in particular when disabling many
extensions at once, for instance when locking the screen.
Help with that by sorting extensions by the number of session-modes,
as extensions that support multiple modes are less likely to be
disabled on session mode changes.
Florian Müllner [Wed, 6 Dec 2023 14:45:17 +0000 (15:45 +0100)]
st/bin: Delegate child allocation to layout manager
Since commit ed3b8d093e16, the actor's single-child policy is
enforced even when using the generic add/remove_child() methods.
This makes it possible to follow GTK/AdwBin's lead and replace
out custom child allocation with a BinLayout, without changing
the actor's semantics in a fundamental way.
However this does change slightly how the child is allocated, as
it now only expands according to its expand properties, not when
the alignment is set to FILL.
Even after the preparations in the previous commit, some fallout
is still likely, but it will be easy to address, and the cleanup
is significant enough to justify it.
Florian Müllner [Wed, 6 Dec 2023 14:46:12 +0000 (15:46 +0100)]
js: Explicitly set expand of St.Bin children
Right now, St.Bin ignores the child's expand properties, and
instead expands the child if its alignment is set to FILL.
This will change when we replace the custom allocation code
with a layout manager, so to prepare for that, set the expand
property where needed to keep the expected behavior.
Florian Müllner [Thu, 14 Dec 2023 20:30:00 +0000 (21:30 +0100)]
shell/app: Remove X11-specific icon fallback
We have considered .desktop files a required app component for
more than 10 years now. It also has been several years that the
default session switched to wayland, which doesn't have protocol
for window icons.
So stop using an elaborate fallback path just for legacy clients,
and just fall back to the same generic icon we use for wayland
clients.
Sam Hewitt [Tue, 14 Nov 2023 14:00:45 +0000 (10:30 -0330)]
style: Rewrote app grid tile drawing functions
- updated mixin for tile_button
- dropped the overview_button mixin
- minor changes to dash, appDisplay and switcherPopup JS to accommodate new stylesheet
- new focus style for all tile buttons
- improved high contrast style support for app grid and dash
- renamed some style-classes
- tidied up dash stylesheet
Daniel van Vugt [Thu, 1 Jul 2021 08:03:57 +0000 (16:03 +0800)]
Pass 'radius' to blur APIs instead of 'sigma'
Requires mutter!1908 first.
So now consumers of the clutter blur code don't have to know the
implementation is Gaussian and no longer need to convert the intended
blur radius to a sigma value.
- The "user menu" was replaced with "system menu" years ago, so
update the terminology in the summary and description
- Remove the full stop from the end of the summary for consistency
- More verbosely describe the behavior that's being overridden to
reduce confusion
Florian Müllner [Wed, 13 Dec 2023 00:11:52 +0000 (01:11 +0100)]
dbusService: Exempt org.gnome.Shell from sender tracking
If an interface has any signals, we don't want to auto-shutdown
while a caller is still connected to a signal.
Unfortunately we can't tell whether there are any signal connections,
so we track all callers instead, and keep the service alive while
any of them is still on the bus.
For services that we call from gnome-shell itself - like screencasts
or extensions - this has the unintended side effect of effectively
disabling auto-shutdown.
Address this by exempting the org.gnome.Shell name from sender
tracking.
Services that we expect to keep running for the lifetime of the
shell already disable auto-shutdown, so the only downside is a
small startup delay to resolve the well-known shell name.
st/widget: Don't allow adding/removing "" style class
strstr() in find_class_name() will always consider "" a match so the
loop was not stopping at the end of the class_list. None of the matches
within the class_list would satisfy the return conditions, unless the
class_list was either an empty string as well or has a trailing space.
So this ends up with a match outside of the allocated string that
happens to satisfy these conditions by chance which then leads to the
class string containing some of this unrelated memory. Or it might lead
to a segfault.
This adds checks to the public API that uses find_class_name() to
prevent extensions from accidentally triggering a crash this way or
having some otherwise unexpected results.
Sam Hewitt [Wed, 29 Nov 2023 17:48:59 +0000 (14:18 -0330)]
style: Improve text scaling support
- new drawing function to convert px to em, for select instances
- updated fontsize function to convert fonts in pt to em
- replace instances of discrete sizes with defined values
- fix instances where assets or icons did not scale along with text
- rework panel buttons to accommodate the scaling padding and icons
- new 'scalable' definitions for elements that follow text scaling
Florian Müllner [Sat, 2 Dec 2023 00:30:39 +0000 (01:30 +0100)]
doc: Add README for toolbox tooling
Now that we have a collection of scripts around the toolbox
workflow, it makes sense to add a brief overview over the
available tools.
For now it's just located in the corresponding tools folder,
but it gives us something to point to once we overhaul the
toplevel documentation as part of the wiki migration.
Florian Müllner [Sat, 2 Dec 2023 00:42:17 +0000 (01:42 +0100)]
tools: Remove outdated jhbuild setup script
As useful as the custom jhbuild setup was at the time, it has been
superseded by jhbuild proper (which gained the ability to install
system dependencies since) or alternatives like containers.
Given that the script hasn't been meaningfully updated for almost
10 years, its list of dependencies is hopelessly outdated, and it's
therefore more likely to confuse newcomers than being of actual
help.
As much as I have fond memories of the script when starting out,
it's finally time to retire.
Wrapping the gnome-shell call with `dbus-run-session` is *mostly*
enough for testing, but not quite.
When running without gnome-session, the wayland display is not
propagated to the D-Bus daemon, so any app that is D-Bus activated
still opens in the host session.
This can be worked around by using a specific wayland-display name
and exporting it to the `dbus-run-session` environment up-front.
At this point the invocation is finicky enough to justify another
convenience script. This also gives us a place to expose some
useful features for testing, like forcing a right-to-left layout
or simulating the greeter.
We don't require any build steps other than the standard meson
commands, but entering a toolbox and running 2-3 meson commands
still adds some friction.
Add a small convencience script that
- finds the toplevel source directory (similar to `jhbuild make`)
- enters the speficied toolbox (or the configured default)
- automatically picks a build directory based on the toolbox name
- builds and installs the project to /usr (inside the toolbox)
It also allows specifying meson -D options to change the build
configuration, and to optionally run `meson dist`.
Setting up more than one gnome-shell toolbox is uncommon, and users
shouldn't have to specify --set-default for other tools to pick the
right default.
It would be possible to detect the number of containers that were
created from the shell toolbox image, but the far easier option is
to just set up the first container as default.
Aryan Kaushik [Fri, 27 Oct 2023 09:28:19 +0000 (14:58 +0530)]
extensions-app: Support "version-name" metadata field
The extensions site recently added support for a custom
"version-name" string in metadata:
gitlab.gnome.org/Infrastructure/extensions-web/-/merge_requests/154
This allows developers to control the version that is exposed to
users. As the version according to the developer is almost always
more relevant than the automatic version assigned by the website,
use it instead of the "version" field if set.
Peter Hutterer [Fri, 24 Nov 2023 03:16:12 +0000 (13:16 +1000)]
padOsd: Fix rings and strips event handling
JS ERROR: TypeError: event.get_pad_event_details is not a function
vfunc_captured_event@resource:///org/gnome/shell/ui/padOsd.js:824:53
@resource:///org/gnome/shell/ui/init.js:21:20
Florian Müllner [Tue, 21 Nov 2023 12:28:30 +0000 (13:28 +0100)]
dbusServices/extensions: Only show dialog when loaded
After the port to ESM, an extension's `prefs.js` file is imported
asynchronously. An unintended side effect of that is that we now
show the dialog before anything can be added to the window (either
by the extension, or the fallback error UI).
The delay almost always won't be noticeable to users, but it's
bad practice and prevents extensions from using some API that
only works before the window is realized.
To address the issue, add a `loaded` signal to the dialog that allows
the caller to postpone showing the window until the UI is ready.
Charles Wong [Sat, 28 Oct 2023 07:34:36 +0000 (15:34 +0800)]
main: Instantiate EndSessionDialog
Using an exported `init()` function to create the object is an odd
pattern, and not having the object referenced anywhere makes it harder
to access for debugging or extensions.
Just export the `EndSessionDialog` class and instantiate it like we
do for other objects.
Florian Müllner [Thu, 26 Oct 2023 11:39:38 +0000 (13:39 +0200)]
slider: Request a size
Sliders (and level bars) currently don't request any size, so it's
up to the caller (or stylesheet) to explicitly set a size big
enough to fit the bar/handle.
That's rather unexpected, we should request the size we need ourselves.
Florian Müllner [Thu, 26 Oct 2023 13:17:45 +0000 (15:17 +0200)]
barLevel: Stop capping border-width at 1 pixel
I can't think of a reason why limiting the border to a maximum
would make any sense.
The original intention was probably to set a minimum border width
to avoid having to deal with border/no-border complexity in the code,
but as cairo accepts a line width of 0, it just works.
However limiting the size to the overall height seems reasonable,
as at that size a bigger height and different fill color can
achieve the same effect without requires special handling of
other values like the radius.
Florian Müllner [Wed, 8 Nov 2023 18:41:18 +0000 (19:41 +0100)]
status/volume: Always look up device objects
Gvc may clean its device cache after we set up the device menu,
which can lead to failed assertions when using the "old" object
to later switch the device from a callback.
Make sure this doesn't happen by looking up the ID again from
the callback.
Julian Sparber [Tue, 21 Nov 2023 10:29:46 +0000 (11:29 +0100)]
st/viewport: Set adjustment properties all at once
This ensures that that property changes are notified all at the same
time and only after all were set. If we notify too early handlers
may act on a "broken" viewport.
Julian Sparber [Tue, 21 Nov 2023 10:20:06 +0000 (11:20 +0100)]
st/adjustment: Ensure changed signal emission is compressed
The docs say that `st_adjustment_set_values()` emits the `changed`
signal only once but it's actually emitted for each changed property,
this uses the `dispatch_properties_changed` vfunc to emit the `changed`
signal only per call to `st_adjustment_set_values()`. As a positive
side effect this also makes it possible to use `g_object_freeze/thaw_notify`
to compress the `changed` signal emission when using the setters for
properties.
This also fixes the wrong emission of the `changed` signal in
`st_adjustment_set_values()` when only the `value` property is changed.
Side note: the code is heavily inspired by GtkAdjustment
Florian Müllner [Fri, 17 Nov 2023 17:31:32 +0000 (18:31 +0100)]
shellDBus: Await Eval() result
The Eval() method currently evaluates the provided string, and
returns the result immediately. This isn't useful when a promise
is returned, which has become much more likely now that accessing
any module requires import().
Simply await the result, to handle both sync and async code.
Florian Müllner [Wed, 15 Nov 2023 13:41:07 +0000 (14:41 +0100)]
st/scroll-view: Change default hscrollbar-policy
It is a bit odd to have different default values for the vertical
and horizontal policy, but then that's what we almost always want in
practice: Automatic scrolling vertically, and no scrolling horizontally.
Florian Müllner [Wed, 15 Nov 2023 14:06:33 +0000 (15:06 +0100)]
st/scroll-view: Add private API to query bar offsets
The scroll fade effect is the only component that accesses the
{v,h}scroll properties for anything other than getting access
to the corresponding adjustments.
Allow the effect to get what it needs via new private API instead,
so we can deprecate and eventually remove the scroll bar properties.
Florian Müllner [Wed, 15 Nov 2023 12:50:42 +0000 (13:50 +0100)]
st/scroll-view: Expose adjustments as properties
The adjustments are currently only accessible indirectly via
the scroll bars. It is a bit odd to expose internal children,
and as nearly all users only access them for the adjustments,
it makes sense to expose those instead.
Jonas Dreßler [Wed, 16 Feb 2022 15:16:49 +0000 (16:16 +0100)]
st/scroll-view: Hide scroll bar from layout when its hidden
We hide scrollbars with POLICY_AUTOMATIC when the content of the scroll
view fits completely inside the view without having to scroll. In this case
it seems like a good idea to give the content the full available size
without subtracting scroll bars from that size.
So subtract the scroll bar from the size we give to the child only when
the scroll bar is actually visible, when it's invisible subtract 0 instead.
Jonas Dreßler [Tue, 1 Aug 2023 18:35:28 +0000 (20:35 +0200)]
st/scroll-view: Allocate the scrollbars 0-size instead of not painting them
StScrollView applies the policy of whether to show or hide the scroll
bar,
and with the AUTOMATIC policy the scroll bar should be hidden as soon as
the
content of the scroll view is small enough to fit without scrolling.
Now we only know about the final size of the content when we're inside
st_scroll_view_allocate(), so that's where we can decide whether the
scroll
bar should be visible or not. Clutter really doesn't like calling
clutter_actor_show/hide() in the middle of an allocation cycle though,
so
what we do instead is saving the state into priv->vscrollbar_visible,
and
then just not painting the scroll bar based on that in a paint() vfunc
override.
This approach is not great for several reasons, it means we also have to
override pick() and finally it means the paint volume of the scroll bar
is
incorrect.
While the greatest solution to this would be to just hide/show the
scroll
bar inside the allocate() function as it is possible in gtk, we have an
established pattern for this kind of case too: We usually allocate a
0-sized
rect for the thing we want to hide, so let's do that instead.
A nice side effect is that we can conveniently drop another paint() and
pick() vfunc override.
Sebastian Keller [Wed, 15 Nov 2023 09:21:35 +0000 (10:21 +0100)]
main: Move g_setenv() calls before calls that may start threads
setenv() is not thread-safe and must happen before starting threads. The
g_setenv() calls in main() happened after meta_context_configure(),
which will start a thread via meta_profiler_new() which in its init
calls g_bus_get().